<template>
	<view class="wrap">
		<view class="btn-custom-service" @click="navTo('service')">
			<text class="micon iconlessonfont icon-kefu-xian"></text>
			<text>客服</text>
		</view>
		<view class="btn-class-list" @click="noSupport">
			<text class="micon iconfont iconxuankedan"></text>
			<!-- <navigator url="./lesson-ucar"><text>选课单</text></navigator> -->
			<text>选课单</text>
		</view>
		<!-- <view class="btn-homochromatism btn-preset" @click="navTo('lesson-schedule')">选择时间和老师</view> -->
		<!-- <view class="btn-homochromatism btn-preset" @click="navTo('lesson-order')">前往支付</view> -->
		<view class="btn-homochromatism btn-preset" @click="navTo">前往支付</view>
		<!-- <view class="btn-homochromatism btn-enroll">立即报名</view> -->
	</view>
</template>

<script>
	export default{
		props: {
			course: Object
		},
		methods:{
			noSupport(){
				return uni.showToast({
					title: "暂不支持该功能",
					icon: "none"
				})
			},
			// navTo(url){
			// 	// 没有课程信息
			// 	if(!this.course || !this.course.course_id){
			// 		return uni.showToast({
			// 			title: "没有课程信息",
			// 			icon: 'none'
			// 		})
			// 	}
			// 	// 设置选择的课程信息
			// 	uni.setStorage({
			// 		key: 'course',
			// 		data: [this.course],
			// 		success(){
			// 			uni.navigateTo({
			// 				url: url
			// 			})						
			// 		}
			// 	})
			// }
			navTo(url){
				var _this = this;
				if(url == 'service') {
					_this.$emit('showPhone');
					return
				}
				// 没有课程信息
				if(!this.course || !this.course.course_id){
					return uni.showToast({
						title: "没有课程信息",
						icon: 'none'
					})
				}
				// 设置选择的课程信息
				uni.setStorage({
					key: 'course',
					data: [this.course],
					success(){
						_this.$emit('isshow');					
					}
				})
			}
		}
	}
</script>

<style scoped>
	@import url("../../../static/font_lesson/iconfont.css");
	.wrap{display:flex; align-items: center; height:110upx;font-family: Source Han Sans CN; position: fixed; bottom: 0; width: 100%; background: #fff;}
	.wrap>view{height:100%;}
	
	.btn-custom-service, .btn-class-list{color: #666; display:flex; flex-basis:145upx; flex-direction: column; flex-grow: 1; text-align: center;font-size: 28upx;}
	.micon{font-size: 44upx; height:60upx;color: #666;}
	.iconlessonfont {font-family: iconlessonfont;}
	
	.btn-homochromatism{display: flex; justify-content: center; align-items: center; flex:2; flex-basis:230upx; color:#fff; font-size:32upx; text-align: center; line-height:104upx;font-weight: 500;}
	.btn-add-list{background:#fe9900;}
	.btn-preset{background:#fe9900;min-width: 440upx;}
	.btn-enroll{background:#FFB800;}
</style>
